#include <REGX52.H>
#include "uart.c"
#include "lcd12864.c"
/**
 * 实现Speed界面
 */

/**
 * 左右箭头，4x8
 */
unsigned char LEFT_ARROW[] = {0x08, 0x1c, 0x3e, 0x7f};
unsigned char RIGHT_ARROW[] = {0x7f, 0x3e, 0x1c, 0x08};

/**
 * SPEED 字模，4x8
 */
unsigned char SPEED_CHARS[] = {
    0x46, 0x49, 0x49, 0x31,  // S
    0x00,                    // 空一列
    0x7F, 0x09, 0x09, 0x06,  // P
    0x00,                    // 空一列
    0x7F, 0x49, 0x49, 0x49,  // E
    0x00,                    // 空一列
    0x7F, 0x49, 0x49, 0x49,  // E
    0x00,                    // 空一列
    0x7F, 0x41, 0x41, 0x3E}; // D

void main()
{
    uart_init();
    lcd_init();
    lcd_clean_screen();
    // 显示上下两个黑条
    lcd_display_same_bytes_in_page(0, 0, 0xFF, 128);
    lcd_display_same_bytes_in_page(7, 0, 0xFF, 128);

    // page 3 ，52列，写SPEED
    lcd_display_bytes_in_page(3, 52, SPEED_CHARS, sizeof(SPEED_CHARS));

    // page 4, 写箭头
    lcd_display_bytes_in_page(4, 57, LEFT_ARROW, sizeof(LEFT_ARROW));
    lcd_display_bytes_in_page(4, 67, RIGHT_ARROW, sizeof(RIGHT_ARROW));

    while (1)
    {
    }
}